<%@ Page Language="C#" MasterPageFile="~/Board.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="UserInterface.Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="server">  
    <table class="detail-table">
        <tr>
            <th colspan="2"><%= GetLocalResourceObject("SearchOn") %>:</th>
        </tr>
        <tr>
            <td class="default-column first-column-width" valign="top"><%= GetLocalResourceObject("KeyWords") %>:</td>
            <td class="default-column">
    
                <asp:TextBox ID="KeyWordsTextBox" runat="server" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                    ControlToValidate="KeyWordsTextBox"
                    ErrorMessage="Please enter some search terms" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="default-column" valign="top"><%= GetLocalResourceObject("Type") %></td>
            <td class="default-column">
                <asp:RadioButtonList ID="TypeRadioButtonList" runat="server">
                    <asp:ListItem Text="<%$ Resources: TypeOR %>" Selected="True" />
                    <asp:ListItem Text="<%$ Resources: TypeAND %>" />
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <th colspan="2">Search options:</th>
        </tr>
        <tr>
            <td class="default-column" valign="top"><%= GetLocalResourceObject("TargetTitle") %></td>
            <td class="default-column">
                <p><%= GetLocalResourceObject("TargetDescription") %></p>
                <asp:ListBox ID="TargetListBox" SelectionMode="Multiple" runat="server" Rows="8" Width="300" />
            </td>
        </tr>
        <tr>
            <td class="options-column" colspan="2">
                <asp:Button ID="SearchButton" Text="<%$ Resources: Search %>" OnClick="SearchButton_Click" runat="server" />
            </td>
        </tr>
    </table>
    
    <asp:Panel ID="SearchResultsPanel" Visible="false" runat="server">
        <div id="search-results">
            <h2><%= GetLocalResourceObject("SearchResults") %></h2>
            <p>
                <%= GetLocalResourceObject("NumberOfTopicsFound") %>: <asp:Label ID="NumberOfTopicsLabel" runat="server" />
            </p>
            
            <asp:Repeater ID="SearchResultsRepeater" runat="server">
                <HeaderTemplate>
                    <table class="list-table">
                        <thead>
                            <tr>
                                <th class="forum-width"><%= Resources.Resource.Forum %></th>
                                <th class="topic-title-width"><%= Resources.Resource.Topic %></th>
                                <th class="post-count-width"><%= Resources.Resource.Replies %></th>
                                <th class="last-post-width"><%= Resources.Resource.LastPost %></th>
                            </tr>
                        </thead>
                        <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                            <tr>
                                <td class="default-column"><a href="ViewForum.aspx?forumId=<%# Eval("Forum.Id")%>"><%# Eval("Forum.Name")%></a></td>
                                <td class="default-column"><a href="ViewTopic.aspx?topicId=<%# Eval("Id") %>&amp;messageId=<%# Eval("LastMessage.Id") %>#message_<%# Eval("LastMessage.Id") %>"><%# Eval("Subject") %></a></td>
                                <td class="default-column"><%# Eval("NumberOfReplies")%></td>
                                <td class="default-column"><a class="small-text" href="ViewTopic.aspx?topicId=<%# Eval("Id") %>&amp;messageId=<%# Eval("LastMessage.Id") %>#message_<%# Eval("LastMessage.Id") %>"><img src="Templates/Default/Images/Icons/last-post.gif" alt=""><span><%# Eval("LastMessage.PostDateTime") %></span></a></td>
                            </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                            <tr>
                                <td class="alternate-column"><a href="ViewForum.aspx?forumId=<%# Eval("Forum.Id")%>"><%# Eval("Forum.Name")%></a></td>
                                <td class="alternate-column"><a href="ViewTopic.aspx?topicId=<%# Eval("Id") %>&amp;messageId=<%# Eval("LastMessage.Id") %>#message_<%# Eval("LastMessage.Id") %>"><%# Eval("Subject") %></a></td>
                                <td class="alternate-column"><%# Eval("NumberOfReplies")%></td>
                                <td class="alternate-column"><a class="small-text" href="ViewTopic.aspx?topicId=<%# Eval("Id") %>&amp;messageId=<%# Eval("LastMessage.Id") %>#message_<%# Eval("LastMessage.Id") %>"><img src="Templates/Default/Images/Icons/last-post.gif" alt=""><span><%# Eval("LastMessage.PostDateTime") %></span></a></td>
                            </tr>
                </AlternatingItemTemplate>
                <FooterTemplate>
                        </tbody>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
    </asp:Panel>
</asp:Content>